const axiosReq = axios.create({
    timeout: 5000, // 请求超时时间
    withCredentials: false,
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
})

function httpGet(url, params) {
    return axiosReq.get(url, {
        params: params
    }).then(function (response) {
        return response.data;
    }, function (err) {
        // 返回统一的错误对象
        console.log(err);
        return {
            code: 500,
            msg: '亲，系统出小差了'
        };
    });
}

function isSuccess(resp) {
    return resp.code === 200;
}
